package com.shop.cloud.controller.system;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.shop.cloud.common.TreeNode;
import com.shop.cloud.common.mapper.JsonMapper;
import com.shop.cloud.common.mybatis.BaseController;
import com.shop.cloud.domain.system.SysResource;
import com.shop.cloud.domain.system.SysRoleResource;
import com.shop.cloud.filter.CurrentUserId;
import com.shop.cloud.filter.MagicPermission;
import com.shop.cloud.model.request.AssignAuthorityRequest;
import com.shop.cloud.model.request.DeleteSysUserRequest;
import com.shop.cloud.model.request.GetSysResourceListRequest;
import com.shop.cloud.model.request.GetSysRoleResourceListRequest;
import com.shop.cloud.model.response.AssignAuthorityResponse;
import com.shop.cloud.model.response.GetSysResourceListResponse;
import com.shop.cloud.model.response.GetSysRoleResourceListResponse;
import com.shop.cloud.service.system.ISysResourceService;
import com.shop.cloud.service.system.ISysRoleResourceService;
import com.shop.cloud.util.DateUtils;
import com.shop.cloud.util.ErrorCode;
import com.shop.cloud.util.Response;
import com.shop.cloud.util.ResponseUtil;

@RestController
@RequestMapping(value = "roleresource")
public class SysRoleResourceController extends BaseController {

	private static final Logger logger = Logger
			.getLogger(SysRoleResourceController.class);

	@Autowired
	private ISysRoleResourceService sysRoleResourceService;

	//@MagicPermission
	@RequestMapping(value = "list")
	@ResponseBody
	public Response list(@CurrentUserId Long userId,HttpServletRequest request, HttpServletResponse response, @RequestBody GetSysRoleResourceListRequest getSysRoleResourceListRequest) {
		Map<String, Object> params = null;
		List<GetSysRoleResourceListResponse> datas = new ArrayList<GetSysRoleResourceListResponse>();
		GetSysRoleResourceListResponse data = null;
		List<SysRoleResource> sysRoleResources = null;
		
		return ResponseUtil.ok(datas);
	}
	
	//@MagicPermission
	@RequestMapping(value = "assign")
	@ResponseBody
	public Response assign(@CurrentUserId Long userId,HttpServletRequest request, HttpServletResponse response, @RequestBody AssignAuthorityRequest assignAuthorityRequest) {
		Map<String, Object> params = null;
		AssignAuthorityResponse data = null;
		
		return ResponseUtil.ok(data);
	}

}